package com.zzxz.practicaltrainingsys.entity;

import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;

@Data
public class Notice {
    private Integer notice_id;
    private String notice_name;
    private String notice_content;

    // 修改：使用 java.util.Date 并添加 JsonFormat 注解处理时间格式和时区
    // 接收前端传递的时间格式，支持多种格式
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date notice_time;

    private Integer project_id;
    private Integer teacher_id;

    // 添加构造方法和toString方法用于调试
    public Notice() {}

    public Notice(String notice_name, String notice_content, Date notice_time, Integer project_id, Integer teacher_id) {
        this.notice_name = notice_name;
        this.notice_content = notice_content;
        this.notice_time = notice_time;
        this.project_id = project_id;
        this.teacher_id = teacher_id;
    }

    @Override
    public String toString() {
        return "Notice{" +
                "notice_id=" + notice_id +
                ", notice_name='" + notice_name + '\'' +
                ", notice_content='" + notice_content + '\'' +
                ", notice_time=" + notice_time +
                ", project_id=" + project_id +
                ", teacher_id=" + teacher_id +
                '}';
    }
}